<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
    <title>令牌</title>
    <link th:href="@{/css/mobile.css}" rel="stylesheet">
    <script type="text/javascript" th:src="@{/script/jquery-1.7.2.js}"></script>
</head>
<body>
<div style="position: relative;width: 100%;height: 8vh;left: 0"></div>

<section th:if="${session.userInfo}">
    <div th:if="${totalItems}!=null" th:each="items:${totalItems}">
        <div th:id="${item.getOid()}+'_'+${item.getFid()}" th:each="item:${items}" class="list-box" style="height: 12vh;">
            <div class="right-text-box">
                <p th:text="${item.getFname()}"></p>
                <p th:text=" '数量:' + ${item.getCount()}"></p>
                <br>
                <p th:if="${item.getStatus}=='process' " th:text=" '状态:' + '正在制作' " style="color: #0066ff"></p>
                <p th:if="${item.getStatus}=='finish' " th:text=" '状态:' + '待取餐' " style="color: #00bd23"></p>
                <p th:text=" '窗口:' + ${item.getWindow}"></p>
            </div>
            <button th:if="${item.getStatus}=='finish' " th:onclick="getFood([[${item.getOid()}]],[[${item.getFid()}]]);" class="btn-addToCart">取餐</button>
        </div>
    </div>
    <div th:if="${totalItems}==null">
        <p>没有正在进行的订单</p>
    </div>
</section>
<section th:if="${session.userInfo} == null">
    <p>您还未登录!请先登录</p>
</section>
<script>
    function getFood(oid,fid){
        document.getElementById(oid+'_'+fid).remove();
        $.getJSON("/getItem","action=getItem&oid="+oid+"&fid="+fid);
    }
</script>
</body>
</html>